package net.ttny.java.m1.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import net.ttny.java.m1.dao.UserDao;
import net.ttny.java.m1.entity.User;
import net.ttny.java.m1.service.UserService;

@Service

public class UserServiceImpl implements UserService {
	@Autowired
    private UserDao<User> dao;
	
	public boolean doUserLogin(User user) {
        List<User> list = dao.selectId(user.getNick_name());
        if(list.size() == 0) {
            return false;
        } else {
            if(list.get(0).getPass_word().equals(user.getPass_word())) {
                return true;
            } else {
                return false;
            }
        }
    }
}
